package statement

import (
	"time"
	"wzgames/internal/model/mcomm"
)

type BetResult struct {
	BetId    uint64           `db:"id" json:"bet_id"`
	RoundId  int64            `db:"roundid" json:"round_id"`
	Uid      uint64           `db:"uid" json:"-"`
	Uname    string           `db:"uname" json:"username"`
	AgtId    int64            `db:"agtid" json:"-"`
	CurrId   int32            `db:"currid" json:"currency_id"`
	InstId   int64            `db:"inst" json:"inst_id"`
	GameId   int32            `db:"gameid" json:"game_id"`
	Curr     string           `db:"curr" json:"currency"`
	FreeBet  bool             `db:"freebet" json:"free_bet"`
	Win      mcomm.GameResult `db:"win" json:"win"`
	BetAmt   string           `db:"betamt" json:"bet_amt"`
	EffAmt   string           `db:"effamt" json:"eff_amt"`
	Fee      string           `db:"fee" json:"fee"`
	WinAmt   string           `db:"winamt" json:"win_amt"`
	Payout   string           `db:"payout" json:"payout"`
	BetTime  int64            `db:"bettime" json:"bet_time"`
	PayTime  int64            `db:"paytime" json:"pay_time"`
	AgtUid   string           `db:"agtuid" json:"uid"`
	Status   mcomm.AcStatus   `db:"status" json:"status"`
	VIdx     uint64           `db:"vidx" json:"ver"`
	GAct     mcomm.GameAction `db:"gact" json:"-"`
	Op       int32            `db:"op" json:"-"`
	NodeId   int64            `db:"nodeid" json:"-"`
	Dateline int64            `db:"dateline" json:"-"`
	Detail   string           `db:"details" json:"details"`
	Created  time.Time        `db:"created" json:"-"`
	Updated  time.Time        `db:"updated" json:"-"`
}

type QueryResult struct {
	Last  uint64       `json:"last"`
	Count int64        `json:"count"`
	Per   int32        `json:"per"`
	Data  []*BetResult `json:"data"`
}

type StmVerIdx struct {
	BetId   uint64 `db:"id"`
	AgtId   int64  `db:"agtid"`
	BetTime int64  `db:"bettime"`
	VIdx    uint64 `db:"vidx"`
}

type BetResultSimple struct {
	BetId   uint64           `db:"id"`
	RoundId int64            `db:"roundid"`
	Curr    string           `db:"curr"`
	FreeBet bool             `db:"freebet"`
	Win     mcomm.GameResult `db:"win"`
	BetAmt  string           `db:"betamt"`
	EffAmt  string           `db:"effamt"`
	Fee     string           `db:"fee"`
	WinAmt  string           `db:"winamt"`
	Payout  string           `db:"payout"`
	BetTime int64            `db:"bettime"`
	PayTime int64            `db:"paytime"`
	Detail  string           `db:"details"`
}

type PlayInputData struct {
	Uid       uint64           `db:"uid"`
	Dateline  int64            `db:"dateline"`
	NodeId    int64            `db:"nodeid"`
	CurrId    int32            `db:"currid"`
	InstId    int64            `db:"inst"`
	GameId    int32            `db:"gameid"`
	Precision int32            `db:"precision"`
	BetId     uint64           `db:"betid"`
	RoundId   int64            `db:"roundid"`
	GAct      mcomm.GameAction `db:"gact"`
	CkCode    int32            `db:"ckcode"`
	Balance   string           `db:"balance"`
	Data      string           `db:"data"`
}

type PlayBetEnt struct {
	BetId     uint64    `db:"id"`
	RoundId   int64     `db:"roundid"`
	Uid       uint64    `db:"uid"`
	NodeId    int64     `db:"nodeid"`
	AgtId     int64     `db:"agtid"`
	CurrId    int32     `db:"currid"`
	InstId    int64     `db:"inst"`
	GameId    int32     `db:"gameid"`
	Precision int32     `db:"precision"`
	Curr      string    `db:"curr"`
	GcId      int64     `db:"gcid"`
	FreeBet   bool      `db:"freebet"`
	BetAmt    string    `db:"betamt"`
	EffAmt    string    `db:"effamt"`
	Fee       string    `db:"fee"`
	BetTime   int64     `db:"bettime"`
	Uname     string    `db:"uname"`
	AgtUid    string    `db:"agtuid"`
	Detail    string    `db:"details"`
	Created   time.Time `db:"created"`
	Updated   time.Time `db:"updated"`
}

type PlayPayoutEnt struct {
	BetId   uint64           `db:"id"`
	RoundId int64            `db:"roundid"`
	GAct    mcomm.GameAction `db:"gact"`
	Win     mcomm.GameResult `db:"win"`
	WinAmt  string           `db:"winamt"`
	Payout  string           `db:"payout"`
	PayTime int64            `db:"paytime"`
	Op      int32            `db:"op"`
	Detail  string           `db:"details"`
	Created time.Time        `db:"created"`
	Updated time.Time        `db:"updated"`
}

type PlayCancelEnt struct {
	BetId    uint64 `db:"id"`
	Op       int32  `db:"op"`
	Dateline int64  `db:"dateline"`
}

type PlayStepEnt struct {
	BetId    uint64           `db:"id"`
	RoundId  int64            `db:"roundid"`
	Win      mcomm.GameResult `db:"win"`
	WinAmt   string           `db:"winamt"`
	Payout   string           `db:"payout"`
	Dateline int64            `db:"dateline"`
	Detail   string           `db:"details"`
}
